package com.nulldev.util.crypto.encryptAPI;

import com.nulldev.util.crypto.encryptAPI.huffman.HuffmanCompressor;
import com.nulldev.util.crypto.encryptAPI.manage.Encryptor;

public class Huffman extends Encryptor {

	@Override
	public String getEncryptorID() {
		return "encryptAPI.Huffman";
	}

	@Override
	public String[] supportedEncryptors() {
		return new String[] {"Huffman", "COMPRESSION"};
	}

	@Override
	public String encrypt(String text, String password) {
		return HuffmanCompressor.compressToString(text);
	}

	@Override
	public String decrypt(String text, String password) {
		return HuffmanCompressor.decompressString(text);
	}

	@Override
	public byte[] encryptBytes(byte[] data, String password) {
		return HuffmanCompressor.compress(data);
	}

	@Override
	public byte[] decryptBytes(byte[] data, String password) {
		return HuffmanCompressor.decompressStringB(data);
	}

}
